package com.hoshiicloud.user.entity.usercenter;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 用户积分表实体
 *
 * @author : yangcheng
 * @date : 2019/5/10 10:50
 * @mail : maiboyc@163.com
 **/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class MemberIntegration extends UserCenterBaseEntity implements Serializable {

    private static final long serialVersionUID = 447952709469725027L;

    // 用户ID
    @NotNull(message = "用户主键ID不能为空")
    @ApiModelProperty(name = "userId", value = "用户主键ID", required = true, dataType = "java.lang.Long", example = "3171776001692664000")
    private Long userId;

    // 积分编号
    @NotNull(message = "积分编号不能为空")
    @ApiModelProperty(name = "integrationno", value = "积分编号", required = true, dataType = "java.lang.String", example = "JF0001")
    private String integrationno;

    // 积分获取时间
    @NotNull(message = "积分获取时间不能为空")
    @ApiModelProperty(name = "integrationdate", value = "积分获取时间", required = true, dataType = "java.util.Date", example = "2019-05-06 09:19:04")
    private LocalDateTime integrationdate;

    // 有效期结束
    @NotNull(message = "有效期结束不能为空")
    @ApiModelProperty(name = "expiryto", value = "有效期结束", required = true, dataType = "java.util.Date", example = "2019-05-31 09:19:04")
    private LocalDateTime expiryto;

    // 积分值
    @NotNull(message = "积分值不能为空")
    @ApiModelProperty(name = "userId", value = "积分值", required = true, dataType = "java.math.BigDecimal", example = "18.00")
    private BigDecimal amount;

    // 来源  1-消费 2-活动 3-退单返回
    @NotNull(message = "来源不能为空")
    @ApiModelProperty(name = "source", value = "来源", required = true, dataType = "java.lang.Integer", example = "1")
    private Integer source;

    // 积分规则
    @NotNull(message = "积分规则不能为空")
    @ApiModelProperty(name = "genRule", value = "积分规则", required = true, dataType = "java.lang.String", example = "同一笔消费，只能获取一次积分，不能重复获取积分")
    private String genRule;

    // 使用说明，规则
    @NotNull(message = "使用说明不能为空")
    @ApiModelProperty(name = "instructions", value = "使用说明", required = true, dataType = "java.lang.String", example = "积分只能在消费时抵扣金额，不能做其他用途")
    private String instructions;

    // 状态 1-有效 2-已过期   3-已作废 4- 已使用
    @NotNull(message = "状态不能为空")
    @ApiModelProperty(name = "status", value = "状态", required = true, dataType = "java.lang.Integer", example = "1")
    private Integer status;

    // 关联订单号
    @NotNull(message = "关联订单号不能为空")
    @ApiModelProperty(name = "reforderno", value = "关联订单号", required = true, dataType = "java.lang.String", example = "B0001")
    private String reforderno;

    // 使用时间
    @NotNull(message = "使用时间不能为空")
    @ApiModelProperty(name = "usedtime", value = "使用时间", dataType = "java.util.Date", example = "2019-05-10 10:28:35")
    private LocalDateTime usedtime;
    
}